import { increment, decrement } from './store/actions/counter'

export default function App({ store }) {
  return (
    <div>
      {/* 从 store 里面获取 */}
      <h3>{store.getState()}</h3>
      <div>
        {/* <button
          onClick={() => store.dispatch({ type: 'INCREMENT', payload: 1 })}
        >
          +1
        </button> */}
        <button onClick={() => store.dispatch(increment(1))}>+1</button>
        <button onClick={() => store.dispatch(increment(5))}>+5</button>
        <button onClick={() => store.dispatch(decrement(1))}>-1</button>
        <button onClick={() => store.dispatch(decrement(5))}>-5</button>
      </div>
    </div>
  )
}
